<?php
/**
 * Created by PhpStorm.
 * User: liu
 * Date: 2/26/16
 * Time: 1:44 AM
 */

require __DIR__ . '/init.php';

if (empty(post('name'))) {
    snail_alert('姓名不能为空');
}
if (empty(post('content'))) {
    snail_alert('评论内容不能为空');
}
if (empty(post('post_id'))) {
    snail_alert('错误的请求');
}

comment_add(post('name'), post('content'), post('post_id'), post("parent"));

header("location: {$_SERVER['HTTP_REFERER']}");